//package com.pks.datacenter.controller.api;
//
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import javax.annotation.Resource;
//import javax.servlet.http.HttpServletRequest;
//
//import org.springframework.context.annotation.Scope;
//import org.springframework.stereotype.Component;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.pks.datacenter.entity.api.ApiRecord;
//import com.pks.datacenter.service.api.ApiRecordService;
//import com.pks.resultful.common.SRemoteResult;
//import com.pks.util.UtilString;
//import com.pks.web.springmvc.controller.BasicController;
//
//
//@RestController
//@RequestMapping(value = "/apiRecord")
//@Scope("prototype")
//@Component("apiRecordController")
//@Api(tags = "24小时内接口调用记录")
//public class ApiRecordController extends BasicController {
//
//	@Resource
//	private ApiRecordService apiRecordService;
//
//	@ApiOperation(value = "列表查询")
//	@ApiImplicitParams({
//		@ApiImplicitParam(name = "apiUserId",value = "接口账号ID", dataType = "Long" , paramType = "query" )
//		,@ApiImplicitParam(name = "apiUserAccount",value = "接口账号名", dataType = "String" , paramType = "query" )
//		,@ApiImplicitParam(name = "apiId",value = "接口ID", dataType = "Long" , paramType = "query" )
//		,@ApiImplicitParam(name = "apiMethodName",value = "接口名称", dataType = "String" , paramType = "query" )
//		,@ApiImplicitParam(name = "offset",value = "分页起始页（默认0）", dataType = "int" , paramType = "query" )
//		,@ApiImplicitParam(name = "pagesize",value = "分页每页行数（默认10）", dataType = "int" , paramType = "query" )
//	})
//	@RequestMapping(value = "/list" , method = RequestMethod.POST)
//	public SRemoteResult<List<ApiRecord>> list(HttpServletRequest request,Long apiUserId ,String apiUserAccount ,Long apiId ,String apiMethodName  ,Integer offset,Integer pagesize) {
//		Map<String, Object> qbuilder = new HashMap<String, Object>();
//		if (apiUserId != null) {
//			qbuilder.put("apiUserId", apiUserId);
//		}
//		if (UtilString.isNotBlank(apiUserAccount)) {
//			qbuilder.put("apiUserAccount", apiUserAccount);
//		}
//		if (apiId != null) {
//			qbuilder.put("apiId", apiId);
//		}
//		if (UtilString.isNotBlank(apiMethodName)) {
//			qbuilder.put("apiMethodName", apiMethodName);
//		}
//		List<ApiRecord> list = new ArrayList<ApiRecord>();
//		int total = 0;
//		total = apiRecordService.getTotalRows(qbuilder);
//		if (total > 0) {
//			list = apiRecordService.findByPage(null, qbuilder);
//		}
//		return SRemoteResult.initPageList(list, total);
//	}
//
//
//}
